// 获取当前时间
function getNowTime() {
    var date = new Date();
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var day = date.getDate();
    var hour = date.getHours();
    if (hour < 10) {
        hour = "0" + hour;
    }
    var minute = date.getMinutes();
    if (minute < 10) {
        minute = "0" + minute;
    }
    var second = date.getSeconds();
    if (second < 10) {
        second = "0" + second;
    }
    return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
}


/**
 * 消息提示
 * @param type 类型
 * @param msg 消息
 */
function notice(type, msg) {
    $("body").append('<div class="alert alert-' + type + ' alert-dismissible fade show top-left-alert" id="myAlert" role="alert"> ' + msg +
        '            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span>' +
        '            </button></div>');

    setTimeout(function () {
        $("#myAlert").alert("close");
    }, 2000);
}